tsteven4 [Sun, 24 Nov 2024 22:34:33 +0000 (15:34 -0700)]
cleanup GUI special member functions (#1387)
* cleanup gui special member functions
These tidy checks had a large impact:
cppcoreguidelines-prefer-member-initializer
modernize-use-default-member-init
modernize-use-equals-default
Some instances of other tidy issues were resolved:
clang-analyzer-optin.cplusplus.VirtualCall
cppcoreguidelines-special-member-functions
readability-inconsistent-declaration-parameter-name
readability-named-parameter
and others.
Overall we have 1334 fewer tidy checks on our code base, a
reduction of 15% of the total!
The user defined dtor for class SettingGroup was eliminated
by using std::vector<std::unique_ptr<VarSetting>> instead of a
QList of raw pointers.
The user defined dtor for class FilterWidget was eliminated
by using std::vector<std::unique_ptr<FilterOption>> instead of a
QList of raw pointers.
tsteven4 [Mon, 18 Nov 2024 23:37:34 +0000 (16:37 -0700)]
Refactor GUI map preview (#1385)
* refactor map preview
"Show Only This ..." will pan to the selected waypoint or frame the
selected track or route.
"Show All ..." will recenter the map and reset the bounds.
tsteven4 [Thu, 7 Nov 2024 17:03:01 +0000 (10:03 -0700)]
Use QtLogging Message Pattern to replace MYNAME (#1367)
* use qlogging message pattern to replace MYNAME.
* first cut at removal of MYNAME.
* add message type support
and massage some logging with internal newlines.
* introduce DebugLog class to transform printf ...
style character output into lines suitable for logging.
* handle debug printing in garmin_gpi
including removal of POSIX printf arguement reordring
* use DebugLog with lowranceusr
* use DebugLog in dg100
* fix logging in garmin_txt
* use DebugLog in exif
* use logging for validate.
* fix includes
* use DebugLog in igc
* use logging in kml
* use logging in garmin
* use DebugLog in mtk.
* use DebugLog in tpo
* use logging in trackfilter
* use DebugLog for v900
* use DebugLog in skytraq
* use logging with nmea.
* fix dg100, update references, chop extra newlines.
* appease MSVC C2131
* fix garmin_gpi address debug messages.
and direct vecs debug output to debug msg.
* fix comparison with testo -D 9 igc format
* match globalsat sport ws debug messages
* match ws on fatal()
* update references for option->stderr and
no extra newline on fatal.
* ws
* don't send empty string to QDebug.
* drop another empty string from logging.
* cleanup fatal, flush is done in message handler.
* move conditional logging check earlier.
* make member functions static
* fix debug build.
* eliminate some QString<->QByteArray round trips.
* purse QStrings from fatal routines.
Besides an efficiency hit any variadic argument strings passed to these
routines should already be in local8Bit.
* rename logging functions for easier script editing.
thanks clion.
* add macro gbLogCStr for use with our logging.
All but one line was changed by sed (ok, the sed script took
a few tries.)
This allows us to change the encoding passed to our printf style
logging routines in one place.
* change logging back to using QStrings.
QtMessageHandler operates on QStrings.
* manual rename logging routines in windows only files.
* use global gbLog instead of DebugLog instances.
* convert all gb printflike logging to accumulate lines.
* use gbDebug instead of gbLog. They are equivalent.
* remove unecessary choping.
* fix getLogString, flush fatal log stream.
* terminate gbFatal format strings with a newline.
Since we flush this isn't necessary, but let's be consistent.
* terminate gbWarning format strings.
* switch to our own MessageHandler for legacy logging.
We don't delay logging until we have a complete line, instead
we output any bits as we go. We only format the log message if
the last output for the first message or if the last output
character was a newline.
* rename LegacyLog components.
* update fatal.cc includes
* use same stream in waypt_status_disp & termination in waypt_disp_session.
stderr is a text stream which should translate '\n' -> '\r\n' on windows
automatically.
* review catches, mostly in comments or dead code.
tsteven4 [Thu, 31 Oct 2024 15:41:17 +0000 (09:41 -0600)]
move initialization of OptionInt/Double parameters to constructor (#1364)
* move init of OptionInt/Double parms to ctor
except for id, which isn't known by formats/filters.
Also, move validation of OptionInt/Double strings to Option
class, where it can be maintained in parallel with the conversion
routines.
* init Option id in init_vec, init_filter_vec.
also
fix -Wclazy-unused-non-trivial-variable.
add test of Option error detection.
tsteven4 [Wed, 30 Oct 2024 00:24:17 +0000 (18:24 -0600)]
introduce OptionString, (#1352)
* introduce OptionString,
a replacement for OptionCString. Formats and filters can be
manually converted, with the potential to eliminate c character
string usage.
OptionCString::get() usages can often use an implicit cast from
OptionString instead, although the usage of get() is still valid.
* more OptionCString -> OptionString conversion
* use custom conversion routines.
this introduces OptionString::toInt and OptionString::toDouble,
which enforce error checking on conversions.
* convert more formats to OptionString
* convert gdb to OptionString
* convert xcsv, unicsv to OptionString
* convert html, text to OptionString
* convert ozi to OptionString
* convert mtk to OptionString
* convert globalsat to OptionString
* convert exif to OptionString
* convert lowranceusr to OptionString
* convert igc to OptionString.
note the error checking on timeadj is now done by OptionString::toInt.
* prove igc timeadj works with ints.
* convert shape to OptionString
* convert garmin_gpi to OptionString
* consolidate integer/double parse routines.
* convert subrip to OptionString
* convert garmin_txt to OptionString
* enhance OptionString conversions.
overloads, as opposed to default parameters, allow tools to find differen usages.
improved OptionString error messages with module and argstring information.
* enhance argtype ...
to indicate integer base and if trailing data is allowed.
Use these fields to check and convert integer/doubles in Vecs, fataling on errors.
* allow trailng data with parse_distance, parse_speed.
and when necessary convert these from ARGTYPE_STRING to ARGTYPE_FLOAT.
* fix typo, update refs
* convert garmin to OptionString
* convert skytraq to OptionString
* Introduce OptionInt & OptionDouble.
These must be used with ARGTYPE_INT and ARGTYPE_FLOAT.
The data is checked and converted in Vecs, and the results may
be retrieved by the user.
* convert almost all ARGTYPE_INT to OptionInt.
* final conversion to OptionInt
* mark TODO done.
* correct include comments for greps sake.
* delete complete TODO comments.
* whitespace
* use consistent error messags regarding options.
i.e. "module(option): "
* delete unused Option method type
* use ARGTYPE_STRING if trailing data is allowed.
The GUI validator used with ARGTYPE_INT and ARGTYPE_FLOAT will
reject input with any trailing data.
The CLI, including Vecs::assign_option, keys off the Option subclass now,
not the ARGTYPE.
Note that OptionInt and OptionDouble still allow trailing data. If
trailing data is allowed with these classes we just pair these with
ARGTYPE_STRING which controls validation in the GUI.
* drive arg validation from Option classes.
* simplify use of isEmpty
delete unused macro
delete extraneous file
* non member operator== with parameters const QString& not a candidate,
tsteven4 [Sat, 19 Oct 2024 19:55:51 +0000 (13:55 -0600)]
use consistent unit suffixes. (#1353)
* use consistent unit suffixes.
This is a user visible change. The suffixes for the distance
option of the arcdist, interpolate, radius and position filters
and the add option of the height filter are different.
* drop unused includes
* whitespace
* terminate fatal messages.
* change simplify to process distances in meters.
This simplifies option value parsing.
There is no user visible difference.
tsteven4 [Tue, 8 Oct 2024 12:46:21 +0000 (06:46 -0600)]
prepare for Qt 6.8 deprecations (#1346)
* fix Qt 6.8.0 deprecation warnings.
Also, the exif writer now prefers to establish a timestamp from
GPS_IFD_TAG_DATESTAMP/GPS_IFD_TAG_TIMESTAMP if they exist, as the
exif reader does.
* avoid installing *.debug_information modules
which appeared with 6.7.0
* centralize decision on lightweight time zones.
* correct sort order for includes, duplicates
* remove debug statement
* remove const from declaration.
* simplify lightweight timezone usage via
qt version depependent defined constants.
* fix for QTimeZone not a QLiteralType
* cleanup lightweight time constants.
* enhance exif offset test
* add missing reference
* fix test comment
* revert changes to exif writer regarding gps tags.
I beleive the original intent of the writer is to create the gps tags
from a waypoint.
* update qt modules
* qt 6.8 work
1. allow builds to succeed without webengine by default. This is
needed by CI until aqt catches up.
2. macos minos change for 6.8
3. add macos 6.8.0 to CI, remove macos-12 build.
and actually produce valid html:
1. the replacement for "<body>", "<! >", is invalid.
2. leaving an html tag in causes the html format output to be invalid.
I think someone was waiting for me to say no. Sometimes, "good enough" (for users with no representation here...) seems to be. Co-authored-by: Robert Lipe <robertlipe@users.noreply.github.com>
Robert Lipe [Sat, 14 Sep 2024 04:18:52 +0000 (23:18 -0500)]
Various modernizations in humminbird. (#1100)
* Various modernizations in humminbird.
- Make humminbird_icons[] a QStringList.
- I don't think the icon finder ever actually worked the way it was described in the
comments.
- Comment fix in exif
- Kill xstrndup (yay)
積丹尼 Dan Jacobson [Sun, 18 Aug 2024 22:24:12 +0000 (06:24 +0800)]
Zap repeated examples (#1084)
On https://www.gpsbabel.org/htmldoc-development/fmt_globalsat.html
we observe these two examples are repeated further down, in context too. So they shouldn't also
appear higher up.
I am guessing that I have correctly zapped the higher up pair.
tsteven4 [Sat, 17 Aug 2024 17:37:13 +0000 (11:37 -0600)]
simplify osm_tag option processing. (#1325)
I suspect the check of "tagnd" was used in developement before
opt_tagnd was added. The only thing the check did was ignore
opt_tag values that started with tagnd, they weren't used elsewhere.
tsteven4 [Tue, 6 Aug 2024 19:12:58 +0000 (13:12 -0600)]
correct WGS84 semi minor axis value. (#1310)
It appears the GSR80 value was used instead of the WGS84 value, which
is a very small error.
However, there was a typo in the value in GPS_Math_XYZ_To_WGS84LatLonH
that resulted in an order of magnitude error!
This could lead to GPS_Math_XYZ_To_WGS84LatLonH never converging.
This may be why skytraq created their own function to convert ECEF
to WGS84.